/**
 * 
 */
package com.ihg.hiex.entity.session.meeting;

import org.apache.commons.lang3.StringUtils;

import com.demo2do.core.utils.Alias;

/**
 * @author downpour
 *
 */
@Alias("SessionMeetingTarget")
public enum Target {
    
    ASSESSOR_FACILITATOR("assessor-facilitator", "assessor-facilitator"),
    
    ASSESSOR_DELEGATE("assessor-delegate", "assessor-delegate"),
    
    ADMIN_ASSESSORS("admin-assessors", "admin-assessors"),
    
    ADMIN_DELEGATES("admin-delegates", "admin-delegates");

    private String description;
    
    private String alias;
    
    /**
     * 
     * @param description
     * @param alias
     * @param name
     */
    Target(String description, String alias) {
        this.description = description;
        this.alias = alias;
    }
    
    /**
     * 
     * @param alias
     * @return
     */
    public static Target aliasOf(String alias) {
        for(Target type : Target.values()) {
            if(StringUtils.equalsIgnoreCase(type.getAlias(), alias)) {
                return type;
            }
        }
        return null;
    }
    
    /**
     * 
     * @return
     */
    public boolean isAssessorOwner() {
        return this.equals(ASSESSOR_DELEGATE);
    }
    
    /**
     * 
     * @return
     */
    public boolean isAdminOwner() {
        return this.equals(ADMIN_ASSESSORS) || this.equals(ADMIN_DELEGATES);
    }
    
    public boolean isAdminAssessor() {
        return this.equals(ADMIN_ASSESSORS);
    }
    
    public boolean isAdminDelegate() {
        return this.equals(ADMIN_DELEGATES);
    }
    
    /**
     * 
     * @return
     */
    public boolean isFacilitatorOwner() {
        return this.equals(ASSESSOR_FACILITATOR);
    }
    
    /**
     * @return the description
     */
    public String getDescription() {
        return this.description;
    }
    
    /**
     * 
     * @return
     */
    public String getAlias() {
        return alias;
    }
    
}
